
{if isset($element.values) and not empty($element.values)}
    
    {if not isset($element.value)}{assign var="selected" value=""}
    {else}{assign var="selected" value=$element.value}{/if}
    
    {if not isset($separator)}
        {if isset($element.separator)}{assign var="separator" value=$element.separator}
        {else}{assign var="separator" value=""}{/if}
    {/if}
    
    {assign var="id" value=$name|id}
    {html_checkboxes name="$name" options=$element.values selected=$selected separator="$separator" class="checkbox" id="$id"}

{else}
    {* basically used in case of single value *}
    <input class="checkbox" type="checkbox" id="{$name|id}" name="{$name}"{if $element.value} checked="checked"{/if} /> 
    {if not isset($element.nolabel) or false === $element.nolabel}<label class="checkbox" for="{$name|id}">{$element.label|default:$element.caption}</label>{/if}
    
{/if}


